import count from '@dfeidao/atom-nodejs/db/count';
import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid,systemid } from '../../atom/config';
interface Message {
filter: {
pn: number;
staff_no: string;
};
}
/* 表名 asset_inventory
标题 资产盘点
字段名称 字段标题 字段类型 字段长度 是否为空 是否主键
project_name 项目名称 string 500 √ ⅹ
inventory_people 盘点人 string 50 √ ⅹ
inventory_time 盘点时间 timestamp 50 √ ⅹ
_id id string 50 ⅹ √
productid 产品id string 50 √ ⅹ
project_id 项目编号 string 50 √ ⅹ
customer_reviews 客户签名 blob 50 √ ⅹ
record_no 记录编号 string 50 √ ⅹ
lnventory_name 盘点名称 string 100 √ ⅹ
inventory_people_no 盘点人编号 string 50 √ ⅹ */
export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
const p = query(action_id, session_id, systemid);
// 显示的值
p.prepare('asset_inventory', ['lnventory_name','project_name','inventory_time','inventory_people','record_no','customer_reviews'],
{ productid,inventory_people_no:message.filter.staff_no},20,message.filter.pn, [], ['inventory_time']);
// 下拉框
p.prepare('company_project', ['project_name','project_no'],
{ productid,project_manager_no:message.filter.staff_no},20,1,[], []);
const [dt,dtt] = await p.exec();
// 查询数据总条数
const { prepare, exec } = count(action_id, session_id, systemid);
prepare('asset_inventory', {productid,inventory_people_no:message.filter.staff_no});
const [c] = await exec();

return {dt,dtt,c};
}
